Suggest alternative toolchains for unavailable targets - #5094
Sreehari425 wants to merge 1 commit into
Conversation
| } | ||
| } | ||
|
|
||
| fn find_toolchain_with_target(&self, target: &TargetTuple) -> Option<String> { |
There was a problem hiding this comment.
Do we use this elsewhere? If not, the same as https://github.com/rust-lang/rustup/pull/5094/changes#r4052997668.
There was a problem hiding this comment.
I kept this as a separate helper even though it’s only used here, since I felt moving the toolchain lookup out of remove_components made the function a bit easier to read.
There was a problem hiding this comment.
This func sounds like a method of TargetTuple?
There was a problem hiding this comment.
I don’t think this belongs on TargetTuple, since it only represents the target and has no knowledge of installed toolchains or rustup configuration
I kept it on DistributableToolchain, which already has that context. Moving it to TargetTuple would require passing that context in, making the API more complicated than necessary.
c2597ac to
3d12360
Compare
3d12360 to
c6e412e
Compare
Closes #4164
rustup target remove <target>now suggests another installed toolchain when the target isn't available in the current one. If no other toolchain has the target, the existing error is unchanged.